#!/bin/bash

# Script to clear all "space" symbols at the end of line

if [ "$1" ]; then
	sed -i 's/\s*$//g' "$1"
	echo "$1 processed"
else # Work on stdin
	sed 's/\s*$//g'
fi
